<extend name="Include:Layout"/>
<block name="title">课程详情</block>
<block name="style">
<link rel="stylesheet" href="/Public/Assets/player/plyr.css">
<style>
.button_sp_area .iconfont{font-size:24px;height:24px;width:24px;color:#ef4f4f}
.button_sp_area {
    width: 60%;
    margin: 0 auto;
    text-align: justify;
    text-justify: distribute-all-lines;
    font-size: 0;
}
.button_sp_area:after {
    display: inline-block;
    width: 100%;
    height: 0;
    font-size: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    content: ".";
}
.weui_btn.weui_btn_mini{line-height:30px;width:90px;}
.weui_tabbar_item {padding-bottom:7px;}
.btn-dianzai i {margin-right:10px;}
.red {color:red}
</style>
</block>

<block name="main">
	<div class="weui_tab">
		<div class="weui_navbar">
			<div class="toolbar">
		        <div class="toolbar-inner">
		            <a href="javascript:history.go(-1);" class="picker-button close-popup">关闭</a>
		            <h1 class="title" id="banji_title">课程详情</h1>
		        </div>
		    </div>
		</div>
		<div class="weui_tab_bd container" id="container" style="padding-top:44px;padding-bottom:45px;"">
		    <article class="weui_article" id="detail">
		        <h1>{$banji.title}</h1>
				<p>{:str_to_html($banji['content'])}</p>
		    </article>
		</div>
	</div>
	<div class="weui_tabbar">
    <div class="weui_tabbar_item">
      <div class="weui-row">
      	<div class="weui-col-50 ">
      		<!--<i class="icon iconfont"></i>
      		<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">打赏</a>-->
      	</div>
      	<div class="weui-col-50" style="text-align:center">
      			<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default btn-dianzai" data-id="{$banji.id}" ><i class="icon iconfont <eq name='isdianzai' value='1'>red</eq>"></i><span><eq name="isdianzai" value="1">取消<else/>点赞</eq></span></a>
      	</div>
      </div>
    </div>
  </div>
	<input type="hidden" name="uid" value="{$_SESSION['_loginUser_home']['uid']}"/>
</block>

<block name="script">
<script>
$(".btn-dianzai").click(function(){
	$.showLoading();
	var that = $(this);
	var id = that.attr("data-id");
	var uid = $("input[name=uid]").val();
	$.post('/api/ygcl/dianzai',{id:id,type:'banji',uid:uid},function(ret){
		//console.log(ret);
		$.hideLoading();
		if(ret == '取消'){
			that.find("i").addClass("red");
		}else{
			that.find("i").removeClass("red");
		}
		that.find("span").html(ret);
	})
	
})
</script>
</block>